/**
 * Created by Administrator on 2017/8/3.
 */
var express = require('express');
var router = express.Router();
var movieController = require('../controllers/movie');
var userController = require('../controllers/user');
var promise = require('../util/promise');

//movie列表页
router.get('/list', userController.loginPermission, userController.adminPermission, promise(movieController.list));
//movie录入页
router.get('/add', userController.loginPermission, userController.adminPermission, promise(movieController.add));
//movie详情页
router.get('/detail/:id', userController.loginPermission, promise(movieController.detail));
//movie进行录入
router.post('/create', userController.loginPermission, userController.adminPermission, promise(movieController.create));
//movie进行删除
router.post('/del', userController.loginPermission, userController.adminPermission, promise(movieController.del));
//movie进行修改
router.post('/update', userController.loginPermission, userController.adminPermission, promise(movieController.update));
//movie进行查询
router.post('/search', userController.loginPermission, promise(movieController.search));

module.exports = router;